// pages/collection/collection.js
import  {
  getUserFollows
} from '../../api/index'
Page({

  /**
   * 页面的初始数据
   */
  data: {
    follow: []
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.getUserFollows()
  },

  onShow() {
    this.getUserFollows()
  },

  // 获取用户关注列表
  async getUserFollows() {
    const userInfo = wx.getStorageSync('userInfo') || ''
    const { userId } = JSON.parse(userInfo)
    const { follow } = await getUserFollows({ uid: userId})
    this.setData({follow})
  }
})